/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.refunite.mobile.s60.widget;

import org.javarosa.core.model.Constants;
import org.javarosa.form.api.FormEntryController;
import org.javarosa.form.api.FormEntryPrompt;

/**
 *
 * @author I040022
 */
public class WidgetFactory {
    public static AbstractFormWidget createUIItem(FormEntryController formEntryController, FormEntryPrompt fep, int index){
        AbstractFormWidget retValue = null;
        switch(fep.getControlType()){
            case Constants.CONTROL_SELECT_ONE:
                retValue = new ChoiceGroupQuestionWidget(formEntryController, fep, index);
                break;
                
            default:
                retValue = new SimpleQuestionWidget(formEntryController, fep, index);
                break;
        }
        return retValue;
    }
}
